<template>
  <div class="printForm">
    <div class="area-header">
      <span class="area-header-title">{{ $t('申请单') }}</span>
    </div>
    <table class="printTable">
      <tr>
        <td class="tit">{{ $t('申请标题') }}</td>
        <td colspan="3">{{ form.actTitle }}</td>
      </tr>
      <tr>
        <td class="tit">{{ $t('申请人') }}</td>
        <td>
          <UserSelect
            v-model="form.username"
          />
        </td>
        <td class="tit">{{ $t('申请时间') }}</td>
        <td>
          {{ parseTime(form.applyTime) }}
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('申请金额(元)') }}</td>
        <td colspan="3">
          {{ moneyFormat(form.applyAmount) }}
        </td>
      </tr>
      <tr>
        <td class="tit">{{ $t('备注') }}</td>
        <td colspan="3">
          {{ form.remark }}
        </td>
      </tr>
    </table>
    <FileView :list.sync="form.fileList" data-type="anxin_bonus" />
  </div>
</template>

<script>
    import { getAnxinBonusApplication } from '@/api/anxin/bonus/anxinBonusApplication'
    export default {
        data() {
            return {
                // 表单参数
                form: {},
                // 遮罩层
                loading: false
            }
        },
        created() {
            this.$bus.$emit('async_done')
        },
        methods: {
            // 初始化数据
            init(data) {
                this.loading = true
                if (data != null && data.id !== undefined) {
                    getAnxinBonusApplication(data.id).then(response => {
                        this.form = response.data
                        this.loading = false
                    })
                } else {
                  this.loading = false
                }
            }
        }

    }
</script>
